package dao.impl;

import dao.LoginIconDao;
import pojo.LoginIcon;

import java.sql.SQLException;
import java.util.List;

public class LoginIconDaoImpl extends BaseDao implements LoginIconDao {

    @Override
    public int saveLoginIcon(LoginIcon loginIcon) throws SQLException {
        String sql = "insert into loginicon values(?,?)";
        return update(sql,loginIcon.getCid(),loginIcon.isPass());
    }

    @Override
    public List<LoginIcon> getAllLoginIcon() throws SQLException {
        String sql = "select * from loginicon";
        return queryForList(LoginIcon.class,sql);
    }

    @Override
    public LoginIcon getOneLoginIcon(String cid) throws SQLException {
        String sql = "select * from loginicon where cid = ?";
        return queryForOne(LoginIcon.class,sql,cid);
    }
}
